<admintpl file="header" />
</head>
<body>
	<div class="wrap js-check-wrap">
		<ul class="nav nav-tabs">
			<li class="active"><a href="{:U('study/index')}">学校管理</a></li>
			<li><a href="{:U('study/add')}">添加学校</a></li>
		</ul>
		<form class="well form-search" method="post" action="{:U('Study/index')}">
			分类：
			<select name="cid" style="width: 100px;" id="selected-cid">
				<option value=''>全部</option>
				<foreach name="categorys" item="vo">
					<php>$cid_select=$vo['cid']==$study_cid?"selected":"";</php>
					<option value="{$vo.cid}" {$cid_select}>{$vo.cat_name}</option>
				</foreach>
			</select> &nbsp;&nbsp;
			学校名称：
			<input type="text" name="study_name" style="width: 200px;" value="{$formget.study_name|default=''}" placeholder="请输入学校名称..."> &nbsp;&nbsp;
			学校编号：
			<input type="text" name="study_code" style="width: 200px;" value="{$formget.study_code|default=''}" placeholder="请输入学校编号...">
			<input type="submit" class="btn btn-primary" value="搜索" />
			<a class="btn btn-danger" href="{:U('AdminPost/index')}">清空</a>
		</form>
		<form class="js-ajax-form" method="post">
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('study/listorders')}">排序</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('study/toggle',array('display'=>1))}" data-subcheck="true">显示</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('study/toggle',array('hide'=>1))}" data-subcheck="true">隐藏</button>
				<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:U('Study/delete')}" data-subcheck="true" data-msg="你确定删除吗？">删除</button>
			</div>
			<php> $status=array("1"=>L('DISPLAY'),"0"=>L('HIDDEN')); </php>
			<table class="table table-hover table-bordered table-list">
				<thead>
					<tr>
						<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
						<th width="50">排序</th>
						<th width="50">ID</th>
						<th width="200">学校名称</th>
						<th width="200">编码标识</th>
						<th width="200">所属分类</th>
						<th width="200">有效期</th>
						<th width="50">logo</th>
						<th width="50">状态</th>
						<th width="100">操作</th>
					</tr>
				</thead>
				<foreach name="tudys" item="vo">
				<tr>
					<td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$vo.study_id}"></td>
					<td><input name='listorders[{$vo.study_id}]' class="input input-order mr5" type='text' size='3' value='{$vo.listorder}'></td>
					<td>{$vo.study_id}</td>
					<td>{$vo.study_name}</td>
					<td>{$vo.study_code}</td>
					<td>{$vo.cat_name}</td>
					<td>{$vo.end_time} / {$vo.time_str}</td>
					<td>
						<if condition="empty($vo['study_pic'])">
							<img src="__TMPL__Public/assets/images/default-thumbnail.png" width="135" style="cursor: hand"/>
							<else />
							<img src="{:sp_get_image_preview_url($vo['study_pic'])}" width="135" style="cursor: hand; height: 113px;"/>
						</if>
					</td>
					<td>{$status[$vo['study_status']]}</td>
					<td>
						<a href="{:U('study/edit',array('id'=>$vo['study_id']))}">编辑</a>
						<a href="{:U('study/delete',array('id'=>$vo['study_id']))}" class="js-ajax-delete">删除</a>
						<if condition="empty($vo['study_status']) eq 1">
							<a href="{:U('study/cancelban',array('id'=>$vo['study_id']))}" class="js-ajax-dialog-btn" data-msg="确定显示此幻灯片吗？">显示</a>
						<else />
							<a href="{:U('study/ban',array('id'=>$vo['study_id']))}" class="js-ajax-dialog-btn" data-msg="确定隐藏此幻灯片吗？">隐藏</a>
						</if>
					</td>
				</tr>
				</foreach>
				<tfoot>
					<tr>
						<th width="15"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
						<th width="50">排序</th>
						<th width="50">ID</th>
						<th width="200">学校名称</th>
						<th width="200">编码标识</th>
						<th width="200">所属分类</th>
						<th width="50">logo</th>
						<th width="50">状态</th>
						<th width="100">操作</th>
					</tr>
				</tfoot>
			</table>
			<div class="table-actions">
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Study/listorders')}">排序</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Study/toggle',array('display'=>1))}" data-subcheck="true">显示</button>
				<button class="btn btn-primary btn-small js-ajax-submit" type="submit" data-action="{:U('Study/toggle',array('hide'=>1))}" data-subcheck="true">隐藏</button>
				<button class="btn btn-danger btn-small js-ajax-submit" type="submit" data-action="{:U('Study/delete')}" data-subcheck="true" data-msg="你确定删除吗？">删除</button>
			</div>
		</form>
	</div>
	<script src="__PUBLIC__/js/common.js"></script>
	<script>
		setCookie('refersh_time', 0);
		function refersh_window() {
			var refersh_time = getCookie('refersh_time');
			if (refersh_time == 1) {
				window.location.reload();
			}
		}
		setInterval(function() {
			refersh_window()
		}, 3000);
	</script>
</body>
</html>